import { useState,useCallback } from 'react';
import Edit from './edit';
import { Button } from 'antd';
const index = () => {
  const [open,setOpen]=useState(false)
  const [role,setRole]=useState({id:0,name:""})
  const addHandle=()=>{
    setRole({id:0,name:""})
    setOpen(true);
  }
  const close = useCallback(() => setOpen(false), []);
  return (
    <div>角色管理

       <Button onClick={()=>addHandle()}>添加角色</Button>
       <Edit close={close} role={role} open={open}></Edit>
    </div>
  );
}
export default index;